from lib.board.led.ws2812 import ws2812
import time

class LED:
    def __init__(self, pin):
        self.__ws2812 = ws2812.WS2812(pin, 1)

    def set_pin(self, pin, num):
        self.__ws2812 = ws2812.WS2812(pin, num)

    def on(self):
        # print("ws2812 on")
        self.__ws2812.fill((255, 255, 255))

    def off(self):
        # print("ws2812 off")
        self.__ws2812.fill((0, 0, 0))

    def blink(self):
        self.on()
        time.sleep(0.5)
        self.off()


if __name__ == "__main__":
    led = LED(21)
    led.blink()
